#include<iostream>
using namespace std;
#include<vector>
int main() {
	int n, x,y=0;
	cin >> n >> x;
	vector<int> h(n - 1);
	for (int i = 0; i < n - 1; ++i)
		cin >> h[i];
	for (int left = 0, right = -1, sum = 0; left < n - 1; ++left) {
		while (right < n - 1 && sum < 2 * x) sum += h[++right];
		y = max(y, right - left+1);
		sum -= h[left];
	}
	cout << y;
}